package com.training.java.core.homework01;

public class Laptop {

	// Variables
	private final String serialNumber = "LENOVO-2420106";
	private boolean powerOn;
	private double memory;
	private double diskCapacity;

	private LaptopLocations location;

	private double maxMemory = 4;
	private double maxDiskCapacity = 100;
	
	// Methods
	Laptop(LaptopLocations location) {
		this.powerOn = false; // instantiate with a default of false
		this.memory = maxMemory;
		this.diskCapacity = maxDiskCapacity;
		this.location = location;
		
		System.out.println("A Laptop object, " + serialNumber + " is instantiated with no power, memory = " + this.memory + " GB" +
				" disk capacity = " + this.diskCapacity + " GB" + " location = " + this.location + ".");
	}

	public void start() {
		if (this.powerOn == false) {
			this.powerOn = true;
		}
		System.out.println("laptop is started... .");
	}

	public void stop() {
		if (this.powerOn == true) {
			this.powerOn = false;
		}
		System.out.println("laptop is stoping ... stopped now.");
	}

	public void upgrade(double maxMemory, double maxDiskCapacity) {
		this.maxMemory = maxMemory;
		this.diskCapacity = maxDiskCapacity;
		
		System.out.println("laptop has been upgraded to, memory = " + this.maxMemory + " GB" +
				" disk capacity = " + this.diskCapacity + " GB");
	}

	public void move(LaptopLocations location) {
		this.location = location;
		System.out.println("I am at " + this.location + " now.");
	}

	// Getters
	public boolean isPowerOn() {
		return this.powerOn;
	}

	public double getMemory() {
		return this.memory;
	}

	public double getDiskCapacity() {
		return this.diskCapacity;
	}

	public LaptopLocations getLocation() {
		return this.location;
	}

	public double getMaxMemory() {
		return this.maxMemory;
	}

	public double getMaxDiskCapacity() {
		return this.maxDiskCapacity;
	}
}
